\(\int \frac {\tan (x)}{(a+b \cot ^2(x))^{5/2}} \, dx\) [57]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [F]
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 118 \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )}{a^{5/2}}-\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )}{(a-b)^{5/2}}+\frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}+\frac {(2 a-b) b}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}} \]

[Out]

arctanh((a+b*cot(x)^2)^(1/2)/a^(1/2))/a^(5/2)-arctanh((a+b*cot(x)^2)^(1/2)/(a-b)^(1/2))/(a-b)^(5/2)+1/3*b/a/(a
-b)/(a+b*cot(x)^2)^(3/2)+(2*a-b)*b/a^2/(a-b)^2/(a+b*cot(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.467, Rules used = {3751, 457, 87, 157, 162, 65, 214} \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )}{a^{5/2}}+\frac {b (2 a-b)}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}}-\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )}{(a-b)^{5/2}}+\frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}} \]

[In]

Int[Tan[x]/(a + b*Cot[x]^2)^(5/2),x]

[Out]

ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a]]/a^(5/2) - ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a - b]]/(a - b)^(5/2) + b/(3
*a*(a - b)*(a + b*Cot[x]^2)^(3/2)) + ((2*a - b)*b)/(a^2*(a - b)^2*Sqrt[a + b*Cot[x]^2])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 87

Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Simp[f*((e + f*x)^(p +
 1)/((p + 1)*(b*e - a*f)*(d*e - c*f))), x] + Dist[1/((b*e - a*f)*(d*e - c*f)), Int[(b*d*e - b*c*f - a*d*f - b*
d*f*x)*((e + f*x)^(p + 1)/((a + b*x)*(c + d*x))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && LtQ[p, -1]

Rule 157

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)), x_Symb
ol] :> Simp[(b*g - a*h)*(a + b*x)^(m + 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f
))), x] + Dist[1/((m + 1)*(b*c - a*d)*(b*e - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*Simp[(a*d*f*
g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a*h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p
+ 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && LtQ[m, -1] && IntegersQ[2*m, 2*n, 2*p]

Rule 162

Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :>
 Dist[(b*g - a*h)/(b*c - a*d), Int[(e + f*x)^p/(a + b*x), x], x] - Dist[(d*g - c*h)/(b*c - a*d), Int[(e + f*x)
^p/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{x \left (1+x^2\right ) \left (a+b x^2\right )^{5/2}} \, dx,x,\cot (x)\right ) \\ & = -\left (\frac {1}{2} \text {Subst}\left (\int \frac {1}{x (1+x) (a+b x)^{5/2}} \, dx,x,\cot ^2(x)\right )\right ) \\ & = \frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}-\frac {\text {Subst}\left (\int \frac {a-b-b x}{x (1+x) (a+b x)^{3/2}} \, dx,x,\cot ^2(x)\right )}{2 a (a-b)} \\ & = \frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}+\frac {(2 a-b) b}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}}+\frac {\text {Subst}\left (\int \frac {-\frac {1}{2} (a-b)^2+\frac {1}{2} (2 a-b) b x}{x (1+x) \sqrt {a+b x}} \, dx,x,\cot ^2(x)\right )}{a^2 (a-b)^2} \\ & = \frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}+\frac {(2 a-b) b}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}}-\frac {\text {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\cot ^2(x)\right )}{2 a^2}+\frac {\text {Subst}\left (\int \frac {1}{(1+x) \sqrt {a+b x}} \, dx,x,\cot ^2(x)\right )}{2 (a-b)^2} \\ & = \frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}+\frac {(2 a-b) b}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}}-\frac {\text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b \cot ^2(x)}\right )}{a^2 b}+\frac {\text {Subst}\left (\int \frac {1}{1-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b \cot ^2(x)}\right )}{(a-b)^2 b} \\ & = \frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )}{a^{5/2}}-\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )}{(a-b)^{5/2}}+\frac {b}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}}+\frac {(2 a-b) b}{a^2 (a-b)^2 \sqrt {a+b \cot ^2(x)}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.07 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.66 \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\frac {a \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},\frac {a+b \cot ^2(x)}{a-b}\right )+(-a+b) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},1+\frac {b \cot ^2(x)}{a}\right )}{3 a (a-b) \left (a+b \cot ^2(x)\right )^{3/2}} \]

[In]

Integrate[Tan[x]/(a + b*Cot[x]^2)^(5/2),x]

[Out]

(a*Hypergeometric2F1[-3/2, 1, -1/2, (a + b*Cot[x]^2)/(a - b)] + (-a + b)*Hypergeometric2F1[-3/2, 1, -1/2, 1 +
(b*Cot[x]^2)/a])/(3*a*(a - b)*(a + b*Cot[x]^2)^(3/2))

Maple [F]

\[\int \frac {\tan \left (x \right )}{\left (a +b \cot \left (x \right )^{2}\right )^{\frac {5}{2}}}d x\]

[In]

int(tan(x)/(a+b*cot(x)^2)^(5/2),x)

[Out]

int(tan(x)/(a+b*cot(x)^2)^(5/2),x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 369 vs. \(2 (100) = 200\).

Time = 0.49 (sec) , antiderivative size = 1531, normalized size of antiderivative = 12.97 \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\text {Too large to display} \]

[In]

integrate(tan(x)/(a+b*cot(x)^2)^(5/2),x, algorithm="fricas")

[Out]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qrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)/(a - b)) - ((7*a^4*b - 11*a^3*b^2 + 4*a^
2*b^3)*tan(x)^4 + 3*(2*a^3*b^2 - 3*a^2*b^3 + a*b^4)*tan(x)^2)*sqrt((a*tan(x)^2 + b)/tan(x)^2))/(a^6*b^2 - 3*a^
5*b^3 + 3*a^4*b^4 - a^3*b^5 + (a^8 - 3*a^7*b + 3*a^6*b^2 - a^5*b^3)*tan(x)^4 + 2*(a^7*b - 3*a^6*b^2 + 3*a^5*b^
3 - a^4*b^4)*tan(x)^2)]

Sympy [F]

\[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\int \frac {\tan {\left (x \right )}}{\left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {5}{2}}}\, dx \]

[In]

integrate(tan(x)/(a+b*cot(x)**2)**(5/2),x)

[Out]

Integral(tan(x)/(a + b*cot(x)**2)**(5/2), x)

Maxima [F]

\[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\int { \frac {\tan \left (x\right )}{{\left (b \cot \left (x\right )^{2} + a\right )}^{\frac {5}{2}}} \,d x } \]

[In]

integrate(tan(x)/(a+b*cot(x)^2)^(5/2),x, algorithm="maxima")

[Out]

integrate(tan(x)/(b*cot(x)^2 + a)^(5/2), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 483 vs. \(2 (100) = 200\).

Time = 0.38 (sec) , antiderivative size = 483, normalized size of antiderivative = 4.09 \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=-\frac {{\left (2 \, a^{3} \arctan \left (-\frac {a - b}{\sqrt {-a^{2} + a b}}\right ) - 6 \, a^{2} b \arctan \left (-\frac {a - b}{\sqrt {-a^{2} + a b}}\right ) + 6 \, a b^{2} \arctan \left (-\frac {a - b}{\sqrt {-a^{2} + a b}}\right ) - 2 \, b^{3} \arctan \left (-\frac {a - b}{\sqrt {-a^{2} + a b}}\right ) + \sqrt {-a^{2} + a b} a^{2} \log \left (b\right )\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{2 \, {\left (\sqrt {-a^{2} + a b} \sqrt {a - b} a^{4} - 2 \, \sqrt {-a^{2} + a b} \sqrt {a - b} a^{3} b + \sqrt {-a^{2} + a b} \sqrt {a - b} a^{2} b^{2}\right )}} + \frac {\frac {2 \, {\left (\frac {{\left (7 \, a^{5} b^{2} - 17 \, a^{4} b^{3} + 13 \, a^{3} b^{4} - 3 \, a^{2} b^{5}\right )} \sin \left (x\right )^{2}}{a^{7} b - 3 \, a^{6} b^{2} + 3 \, a^{5} b^{3} - a^{4} b^{4}} + \frac {3 \, {\left (2 \, a^{4} b^{3} - 3 \, a^{3} b^{4} + a^{2} b^{5}\right )}}{a^{7} b - 3 \, a^{6} b^{2} + 3 \, a^{5} b^{3} - a^{4} b^{4}}\right )} \sin \left (x\right )}{{\left (a \sin \left (x\right )^{2} - b \sin \left (x\right )^{2} + b\right )}^{\frac {3}{2}}} + \frac {3 \, \log \left ({\left (\sqrt {a - b} \sin \left (x\right ) - \sqrt {a \sin \left (x\right )^{2} - b \sin \left (x\right )^{2} + b}\right )}^{2}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {a - b}} + \frac {6 \, \sqrt {a - b} \arctan \left (\frac {{\left (\sqrt {a - b} \sin \left (x\right ) - \sqrt {a \sin \left (x\right )^{2} - b \sin \left (x\right )^{2} + b}\right )}^{2} - 2 \, a + b}{2 \, \sqrt {-a^{2} + a b}}\right )}{\sqrt {-a^{2} + a b} a^{2}}}{6 \, \mathrm {sgn}\left (\sin \left (x\right )\right )} \]

[In]

integrate(tan(x)/(a+b*cot(x)^2)^(5/2),x, algorithm="giac")

[Out]

-1/2*(2*a^3*arctan(-(a - b)/sqrt(-a^2 + a*b)) - 6*a^2*b*arctan(-(a - b)/sqrt(-a^2 + a*b)) + 6*a*b^2*arctan(-(a
 - b)/sqrt(-a^2 + a*b)) - 2*b^3*arctan(-(a - b)/sqrt(-a^2 + a*b)) + sqrt(-a^2 + a*b)*a^2*log(b))*sgn(sin(x))/(
sqrt(-a^2 + a*b)*sqrt(a - b)*a^4 - 2*sqrt(-a^2 + a*b)*sqrt(a - b)*a^3*b + sqrt(-a^2 + a*b)*sqrt(a - b)*a^2*b^2
) + 1/6*(2*((7*a^5*b^2 - 17*a^4*b^3 + 13*a^3*b^4 - 3*a^2*b^5)*sin(x)^2/(a^7*b - 3*a^6*b^2 + 3*a^5*b^3 - a^4*b^
4) + 3*(2*a^4*b^3 - 3*a^3*b^4 + a^2*b^5)/(a^7*b - 3*a^6*b^2 + 3*a^5*b^3 - a^4*b^4))*sin(x)/(a*sin(x)^2 - b*sin
(x)^2 + b)^(3/2) + 3*log((sqrt(a - b)*sin(x) - sqrt(a*sin(x)^2 - b*sin(x)^2 + b))^2)/((a^2 - 2*a*b + b^2)*sqrt
(a - b)) + 6*sqrt(a - b)*arctan(1/2*((sqrt(a - b)*sin(x) - sqrt(a*sin(x)^2 - b*sin(x)^2 + b))^2 - 2*a + b)/sqr
t(-a^2 + a*b))/(sqrt(-a^2 + a*b)*a^2))/sgn(sin(x))

Mupad [B] (verification not implemented)

Time = 13.68 (sec) , antiderivative size = 2817, normalized size of antiderivative = 23.87 \[ \int \frac {\tan (x)}{\left (a+b \cot ^2(x)\right )^{5/2}} \, dx=\text {Too large to display} \]

[In]

int(tan(x)/(a + b*cot(x)^2)^(5/2),x)

[Out]

atanh((2*a^5*b^13*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10
 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) - (22*a
^6*b^12*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7
*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) + (110*a^7*b^11*(
a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 92
2*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) - (330*a^8*b^10*(a + b/tan
(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8
 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) + (660*a^9*b^9*(a + b/tan(x)^2)^(1/
2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9
*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) - (922*a^10*b^8*(a + b/tan(x)^2)^(1/2))/((a^5
)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 63
0*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) + (912*a^11*b^7*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(
2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^
6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) - (630*a^12*b^6*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^1
3 - 22*a^4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a
^11*b^5 - 80*a^12*b^4 + 10*a^13*b^3)) + (290*a^13*b^5*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^
4*b^12 + 110*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 -
 80*a^12*b^4 + 10*a^13*b^3)) - (80*a^14*b^4*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 1
10*a^5*b^11 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b
^4 + 10*a^13*b^3)) + (10*a^15*b^3*(a + b/tan(x)^2)^(1/2))/((a^5)^(1/2)*(2*a^3*b^13 - 22*a^4*b^12 + 110*a^5*b^1
1 - 330*a^6*b^10 + 660*a^7*b^9 - 922*a^8*b^8 + 912*a^9*b^7 - 630*a^10*b^6 + 290*a^11*b^5 - 80*a^12*b^4 + 10*a^
13*b^3)))/(a^5)^(1/2) - (b/(3*(a*b - a^2)) - (b*(a + b/tan(x)^2)*(2*a - b))/(a*b - a^2)^2)/(a + b/tan(x)^2)^(3
/2) + (atan((((((a + b/tan(x)^2)^(1/2)*(2*a^6*b^12 - 20*a^7*b^11 + 90*a^8*b^10 - 240*a^9*b^9 + 422*a^10*b^8 -
516*a^11*b^7 + 450*a^12*b^6 - 280*a^13*b^5 + 120*a^14*b^4 - 32*a^15*b^3 + 4*a^16*b^2))/2 - (((a - b)^5)^(1/2)*
(2*a^8*b^13 - 22*a^9*b^12 + 110*a^10*b^11 - 328*a^11*b^10 + 644*a^12*b^9 - 868*a^13*b^8 + 812*a^14*b^7 - 520*a
^15*b^6 + 218*a^16*b^5 - 54*a^17*b^4 + 6*a^18*b^3 - ((a + b/tan(x)^2)^(1/2)*((a - b)^5)^(1/2)*(8*a^10*b^13 - 9
6*a^11*b^12 + 520*a^12*b^11 - 1680*a^13*b^10 + 3600*a^14*b^9 - 5376*a^15*b^8 + 5712*a^16*b^7 - 4320*a^17*b^6 +
 2280*a^18*b^5 - 800*a^19*b^4 + 168*a^20*b^3 - 16*a^21*b^2))/(4*(a - b)^5)))/(2*(a - b)^5))*((a - b)^5)^(1/2)*
1i)/(a - b)^5 + ((((a + b/tan(x)^2)^(1/2)*(2*a^6*b^12 - 20*a^7*b^11 + 90*a^8*b^10 - 240*a^9*b^9 + 422*a^10*b^8
 - 516*a^11*b^7 + 450*a^12*b^6 - 280*a^13*b^5 + 120*a^14*b^4 - 32*a^15*b^3 + 4*a^16*b^2))/2 + (((a - b)^5)^(1/
2)*(2*a^8*b^13 - 22*a^9*b^12 + 110*a^10*b^11 - 328*a^11*b^10 + 644*a^12*b^9 - 868*a^13*b^8 + 812*a^14*b^7 - 52
0*a^15*b^6 + 218*a^16*b^5 - 54*a^17*b^4 + 6*a^18*b^3 + ((a + b/tan(x)^2)^(1/2)*((a - b)^5)^(1/2)*(8*a^10*b^13
- 96*a^11*b^12 + 520*a^12*b^11 - 1680*a^13*b^10 + 3600*a^14*b^9 - 5376*a^15*b^8 + 5712*a^16*b^7 - 4320*a^17*b^
6 + 2280*a^18*b^5 - 800*a^19*b^4 + 168*a^20*b^3 - 16*a^21*b^2))/(4*(a - b)^5)))/(2*(a - b)^5))*((a - b)^5)^(1/
2)*1i)/(a - b)^5)/(2*a^6*b^10 - 16*a^7*b^9 + 54*a^8*b^8 - 100*a^9*b^7 + 110*a^10*b^6 - 72*a^11*b^5 + 26*a^12*b
^4 - 4*a^13*b^3 + ((((a + b/tan(x)^2)^(1/2)*(2*a^6*b^12 - 20*a^7*b^11 + 90*a^8*b^10 - 240*a^9*b^9 + 422*a^10*b
^8 - 516*a^11*b^7 + 450*a^12*b^6 - 280*a^13*b^5 + 120*a^14*b^4 - 32*a^15*b^3 + 4*a^16*b^2))/2 - (((a - b)^5)^(
1/2)*(2*a^8*b^13 - 22*a^9*b^12 + 110*a^10*b^11 - 328*a^11*b^10 + 644*a^12*b^9 - 868*a^13*b^8 + 812*a^14*b^7 -
520*a^15*b^6 + 218*a^16*b^5 - 54*a^17*b^4 + 6*a^18*b^3 - ((a + b/tan(x)^2)^(1/2)*((a - b)^5)^(1/2)*(8*a^10*b^1
3 - 96*a^11*b^12 + 520*a^12*b^11 - 1680*a^13*b^10 + 3600*a^14*b^9 - 5376*a^15*b^8 + 5712*a^16*b^7 - 4320*a^17*
b^6 + 2280*a^18*b^5 - 800*a^19*b^4 + 168*a^20*b^3 - 16*a^21*b^2))/(4*(a - b)^5)))/(2*(a - b)^5))*((a - b)^5)^(
1/2))/(a - b)^5 - ((((a + b/tan(x)^2)^(1/2)*(2*a^6*b^12 - 20*a^7*b^11 + 90*a^8*b^10 - 240*a^9*b^9 + 422*a^10*b
^8 - 516*a^11*b^7 + 450*a^12*b^6 - 280*a^13*b^5 + 120*a^14*b^4 - 32*a^15*b^3 + 4*a^16*b^2))/2 + (((a - b)^5)^(
1/2)*(2*a^8*b^13 - 22*a^9*b^12 + 110*a^10*b^11 - 328*a^11*b^10 + 644*a^12*b^9 - 868*a^13*b^8 + 812*a^14*b^7 -
520*a^15*b^6 + 218*a^16*b^5 - 54*a^17*b^4 + 6*a^18*b^3 + ((a + b/tan(x)^2)^(1/2)*((a - b)^5)^(1/2)*(8*a^10*b^1
3 - 96*a^11*b^12 + 520*a^12*b^11 - 1680*a^13*b^10 + 3600*a^14*b^9 - 5376*a^15*b^8 + 5712*a^16*b^7 - 4320*a^17*
b^6 + 2280*a^18*b^5 - 800*a^19*b^4 + 168*a^20*b^3 - 16*a^21*b^2))/(4*(a - b)^5)))/(2*(a - b)^5))*((a - b)^5)^(
1/2))/(a - b)^5))*((a - b)^5)^(1/2)*1i)/(a - b)^5